import request from '@/utils/http'

// 新建地址
export const createAddressAPI = (data) => {
    return request({
      url: '/address',
      method: 'POST',
      data
    })
  }
  
  // 查询
  export const getAddressAPI = () => {
    return request({
      url: '/address',
      method: 'GET'
    });
  };
  
  // 设置默认地址
  export const setDefaultAddressAPI = (id) => {
    return request({
      url: '/address/status',
      method: 'PUT',
      params: {
        id
      }
    });
  };
  
  // 删除
  export const deleAddressAPI = (id) => {
    return request({
      url: '/address',
      method: 'DELETE',
      params: {
        id
      }
    });
  };
  
  // 修改
  export const editAddressAPI = (data) => {
    return request({
      url: '/address',
      method: 'PUT',
      data
    });
  };